<template>
  <div class="Demo1">
      <h1>我是Demo1,{{car}}</h1>
  </div>
</template>

<script>
export default {
    name:'Demo1',
    data(){
        return{
            car:''
        }
    },
    methods:{
        saveCar(c){
            this.car = c
        }
    },
    mounted(){
        this.$bus.$on('atguigu',this.saveCar)
    }
}
</script>

<style>
.Demo1{
    background-color: gray;
    padding: 30px;
}
</style>